{% load currency_filters %}
{% load basket_tags %}
{% load thumbnail %}
{% load i18n %}

<div class="product-single-carousel promotion_single">
    <h3>{{ promotion.name }}</h3>
    <div class="flexslider">
        <ul class="slides">
            {% for product in products %}
            <li>
                <div class="row-fluid">
                    <div class="span4">
                        <div class="image_container"> 
                            {% with image=product.primary_image %}
                            {% thumbnail image.original "200x200" upscale=False as thumb %}
                                <a href="{{ product.get_absolute_url }}"><img class="thumbnail" src="{{ thumb.url }}" alt="{{ product.get_title }}"></a>
                            {% endthumbnail %}
                            {% endwith %}
                        </div>    
                    </div>
                    <div class="span8">
                        <h4>{{ product.stockrecord.partner.name }}</h4>
                        <h2><a href="{{ product.get_absolute_url }}">{{ product.title }}</a></h2>
                        <h3 class="price_color">{% include "catalogue/partials/stock_record.html" %}</h3>
                        <p>{{ promotion.description|safe|truncatechars:250 }}</p>
                        {% if product.is_group %}
                            <a class="btn btn-large" href="{% url catalogue:detail product.slug product.id %}">{% trans "View range" %}</a>
                        {% else %}
                            {% basket_form request product as basket_form single %}
                            <form action="{% url basket:add %}" method="post">
                                {% csrf_token %}
                                {{ basket_form.as_p }}
                                {% if product.is_available_to_buy %}
                                    <button type="submit" class="btn btn-large btn-primary btn-full">{% trans "Add to basket" %}</button>
                                {% else %}
                                    <span class="btn btn-large btn-info disabled">{% trans "Out of Stock" %}</span>
                                {% endif %}
                            </form>
                        {% endif %}
                    </div>
                </div>
            </li>
            {% endfor %}
        </ul>
    </div>
</div>

<div class="hr"><i class="icon-noun_project_62"></i></div>
